package org.huawei260.TiKu.ODsuanfa;

/**
 * @Author: qingle
 * @Date: 2024/10/28-16:11
 * @Description: 3160 【贪心】2024D-停车场车辆统计
 * @version: 1.0
 */
import java.util.Scanner;
public class D_2024D_3160__贪心_停车场车辆统计 {

//	public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);

			String str =
				sc.nextLine()
					.replaceAll(",", "")
					.replaceAll("111", "x")
					.replaceAll("11", "x")
					.replaceAll("1", "x");

			int ans = 0;
			for (int i = 0; i < str.length(); i++) {
				if (str.charAt(i) == 'x') {
					ans++;
				}
			}

			System.out.println(ans);
		}
	}
